package cs2340.g21.wms;

import java.io.IOException;
import java.io.Serializable;
import java.util.Calendar;

/**
 * A class to represent notifications within the app
 * @author Alexander
 *
 */
public class Note extends IOException implements Serializable{
    private String message;
    private User owner;
    private User recipient;
    private Calendar date;
    
    public Note(String message, User recipient, User owner, Calendar date){
        this.message = message;
        this.recipient = recipient;
        this.date = date;
        this.owner = owner;
    }
    
    public User getRecipient(){
        return recipient;
    }
    
    public User getOwner(){
        return owner;
    }
    
    public String getMessage(){
        return message;
    }
    
    public Calendar getDate(){
        return date;
    }
    
    /**
     * Used to serialize note
     * @param out outputstream to which coordinator will be written
     * @throws IOException
     */
    private void writeObject(java.io.ObjectOutputStream out) throws IOException{
            out.defaultWriteObject();   
    }
    
    /**
     * Used to recreate note from an output stream
     * @param in inputstream from which coordinator will be read
     * @throws IOException
     * @throws ClassNotFoundException
     */
    private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException{
        in.defaultReadObject();
    }
}
